import { createElement, HTMLAttributes, type FC } from 'react';
import classNames from 'classnames';

import { stepContentDefaultProps } from './defaultProps';
import type { StepContentOptions } from './type';

export interface StepContentProps extends StepContentOptions, HTMLAttributes<HTMLDivElement> {}

const StepContent: FC<StepContentProps> = (props) => {
  const { className, children, forwardedRef, ...stepContentProps } = props;

  return createElement(
    'div',
    { ref: forwardedRef, className: classNames('content', className), ...stepContentProps },
    children,
  );
};

StepContent.displayName = 'StepContent';
StepContent.defaultProps = stepContentDefaultProps;

export default StepContent;
